package middleware

import (
	"net/http"
	//"runtime/debug"
	"github.com/gin-gonic/gin"
)

// Recovery copy from gin.RecoveryWithWriter
func Recovery(c *gin.Context) {
	defer func() {
		if err := recover(); err != nil {
			//trace := debug.Stack()

			c.AbortWithStatus(http.StatusInternalServerError)
		}
	}()
	c.Next()
}
